#include<iostream>
#include<signal.h>
#include<unistd.h>

int main()
{
    sigset_t set,oset;
    sigemptyset(&set);
    sigemptyset(&oset);
    sigaddset(&set,SIGINT);
    sigaddset(&set,40);

    sigprocmask(SIG_BLOCK,&set,&oset);
    
    std::cout<<"my pid is "<<getpid()<<std::endl;

    sigset_t pending;
    while(1)
    {
        sigpending(&pending);
        for(int i=40;i>0;i--)
        {
            std::cout<<sigismember(&pending,i);
        }

        std::cout<<std::endl;
        sleep(2);
    }

}